package September27;

import java.time.LocalDate;
import java.time.temporal.TemporalAdjusters;
import java.util.ArrayList;
import java.util.List;

public class SundaysOfYear {
    public static void main(String[] args) {
        List<Integer> sundays = new ArrayList<>();
        LocalDate thisYear = LocalDate.now().withDayOfYear(1);
        while (thisYear.getYear() == LocalDate.now().getYear()) {
            if (thisYear.getDayOfWeek() == java.time.DayOfWeek.SUNDAY) {
                sundays.add(thisYear.getDayOfMonth());
            }
            thisYear = thisYear.plusDays(1);
        }
        System.out.println("今年的星期天日期为：");
        for (int day : sundays) {
            System.out.println(day);
        }
    }
}
